package com.apply.repository;

import com.apply.entity.SysAnnounce;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

/**
 * @author tianp
 */
public interface AnnounceRepository extends JpaRepository<SysAnnounce, Long> {
    /**
     * 根据id修改公告内容
     *
     * @param id
     * @param content
     * @return
     */
    @Modifying(clearAutomatically = true)
    @Query("update SysAnnounce set announceInfo = :content where id= :id")
    public int setAnnounceContent(@Param("id") Long id, @Param("content") String content);
}
